/**
 * @param {number[]} nums
 * @return {void} Do not return anything, modify nums in-place instead.
 */
var arr = [0,1,0,3,12];
var arr = [1,0,1,0,2,3];
var moveZeroes = function (nums) {
    let left = 0;
    for (let right = 0; right < nums.length; right++) {
        //右指针不等0 左指针为0则交换位置
        if (nums[right] !== 0) {
            let leftVal = nums[left];
            nums[left] = nums[right];
            nums[right] = leftVal;
            left++;
        }
    }
};
moveZeroes(arr)
console.log(arr);